import request from '@/utils/request'

// 编辑详情
export function getFindById(id) {
  return request.get('/allot/findById/' + id)
}

// 详情
export function detail(id) {
  return request.get('/allot/detail/' + id)
}

// 删除
export function deleteById(id) {
  return request.delete('/allot/del/' + id)
}

//新增 
export function add(form) {
  return request.post('/allot/save', form)
}

//修改
export function update(form) {
  return request.put('/allot/save', form)
}

//获取分页数据 
export function page(form, pageSize, currentPage) {
  return request.post('/allot/page', {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  })
}

// 获取调拨编号
export function getAllotCode() {
  return request.get('/allot/getAllotCode')
}

//获取调拨单数据 
export function partsPage(form, pageSize, currentPage) {
  return request.post('/allot/partsPage', {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  })
}

// 获取所有门店
export function getAllStore() {
  return request.get('store/getAllStore')
}

// 修改调拨状态
export function updateStatus(id, status) {
  return request.get(`/allot/status/${id}/${status}`)
}